#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File              : yExecution.py
# Author            : yang <mightyang@hotmail.com>
# Date              : 03.11.2019
# Last Modified Date: 11.12.2019
# Last Modified By  : yang <mightyang@hotmail.com>


from yBase import yBase
from yVariables import yExecutionStatus

class yExecutionPool(yBase):
    def __init__(self):
        super().__init__()
        self.pool = []

    def putExecution(self, execution):
        self.pool.append(execution)

    def getExecution(self):
        return self.pool.pop(0)


class yExecution(yBase):
    def __init__(self, func, *args, **kwargs):
        super().__init__()
        self.func = func
        self.args = args
        self.kwargs = kwargs
        self.status = yExecutionStatus.Stopped

    def run(self):
        pass


class yProcess(yExecution):
    def __init__(self):
        super().__init__()


class yThread(yExecution):
    def __init__(self):
        super().__init__()

    def run(self):
        pass
